{extend name="main"}
{block name="style"}
<style type="text/css">
	.el-input-group__prepend{padding: 0;}
	.el-input-group__prepend .el-cascader{line-height: 36px;min-width: 150px;}
	.el-input-group__prepend .el-input__inner{height: 36px;border: 0;}
    .search-bg{background-image: url(__TEMPLATE_STATIC__/home_searchbar_img_bg.png);background-size: 100% 100%;}
    .text-white a{color: #FFFFFF!important;}
</style>
{/block}
{block name="header"}
{include file="module/top_nav" container="container-xl"/}
{include file="module/header_concise"/}
{/block}
{block name="body"}
<div class="search-bg mb-3">
<div class="container-xl">
	<div class="search w-75 mx-auto py-5">
		<el-form @submit.native.prevent="setSearchItemKey" class="shadow">
			<el-input placeholder="请输入关键字" v-model="search.key" class="input-with-select el-input__inner-left-none"
			clearable>
			  	<el-cascader
				    v-model="cid"
				    :options="jobscatelist"
				    placeholder="职位分类"
				    :props="defaultProps"
				    filterable
				    clearable
				    :show-all-levels="false"
				     slot="prepend"
				     @change="setSearchItemCid">
			    </el-cascader>
			    <el-button native-type="submit" slot="append">搜索</el-button>
			</el-input>
		</el-form>
		<div class="flex pt-2 text-white">
			<div class="text-white">热门搜索：</div>
			<div class="px-2"><a href="/jobs?key=普工" target="_blank">普工</a></div>
			<div class="px-2"><a href="/jobs?key=销售" target="_blank">销售</a></div>
			<div class="px-2"><a href="/jobs?key=司机" target="_blank">司机</a></div>
			<div class="px-2"><a href="/jobs?key=文员" target="_blank">文员</a></div>
			<div class="px-2"><a href="/jobs?key=管理" target="_blank">管理</a></div>
			<div class="px-2"><a href="/jobs?key=业务员" target="_blank">业务员</a></div>
			<div class="px-2"><a href="/jobs?key=设计" target="_blank">设计</a></div>
			<div class="px-2"><a href="/jobs?key=收银" target="_blank">收银</a></div>
			<div class="px-2"><a href="/jobs?key=服务员" target="_blank">服务员</a></div>
			<div class="px-2"><a href="/jobs?key=导购" target="_blank">导购</a></div>
			<div class="px-2"><a href="/jobs?key=会计" target="_blank">会计</a></div>
		</div>
	</div>
</div>
</div>
<div class="container-xl position-relative text-666666">
	<div class="bg-white shadow p-3">
		<div class="flex border-bottom">
			<div class="w-100px py-3">工作区域：</div>
			<div class="flex-1 overflow-hidden"
			:style="showAllCity?'height:auto;':'height:40px'">
				<div class="row" v-if="arealist">
					<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':(search.province==''&&search.city==''&&search.area=='')}" @click="setSearchItemCity('')">不限</div>
					<div class="col-auto pr-3 py-3 pointer" v-for="(v,index) in arealist" :class="{'text-primary':(search.province==v.id||search.city==v.id||search.area==v.id)}" @click="setSearchItemCity(v)">{{v.title}}</div>
				</div>
				<div class="row border-top" v-show="city.length">
					<div class="col-auto pr-3 py-3 pointer" v-for="(v,index) in city" :class="{'text-primary':search.city==v.id}" @click="setSearchItemCity(v)">{{v.title}}</div>
				</div>
				<div class="row border-top" v-show="area.length">
					<div class="col-auto pr-3 py-3 pointer" v-for="(v,index) in area" :class="{'text-primary':search.area==v.id}" @click="setSearchItemCity(v)">{{v.title}}</div>
				</div>
			</div>
			<div class="py-3 pointer" @click="showAllCity= !showAllCity;">更多<i class="el-icon-caret-top ml-2" v-if="showAllCity"></i><i class="el-icon-caret-bottom ml-2" v-else="showAllCity"></i></div>
		</div>
		<div class="flex flex-center border-bottom">
			<div class="w-100px">更新时间：</div>
			<div class="flex-1">
				<div class="row">
					<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.update_time===''}" @click="setSearchItemUpdateTime('')">不限</div>
					<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in update_time" :class="{'text-primary':search.update_time===v.value}" @click="setSearchItemUpdateTime(v.value)">{{v.title}}</div>
				</div>
			</div>
		</div>
		<div class="flex flex-center border-bottom">
			<div class="w-100px">工作性质：</div>
			<div class="flex-1">
				<div class="row">
					<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.jobs_type===''}" @click="setSearchItemJobsType('')">不限</div>
					<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in jobs_type" :class="{'text-primary':search.jobs_type===v.value}" @click="setSearchItemJobsType(v.value)">{{v.title}}</div>
				</div>
			</div>
		</div>
		<div class="flex flex-center border-bottom">
			<div class="w-100px">职位薪资：</div>
			<div class="row">
				<div class="col-auto pr-3 py-3 pointer"
				:class="{'text-primary':search.salary_min===''&&search.salary_max===''}" @click="setSearchItemSalary();">
					不限
				</div>
				<div class="col-auto pr-3 py-3 pointer" v-for="(v,index) in salary" :class="{'text-primary':search.salary_min==v.salary_min&&search.salary_max==v.salary_max}" @click="setSearchItemSalary(v);">
					<div v-if="jobs_salary_show_type">
						<span v-if="v.salary_min <= 0 && v.salary_max >=100">面议</span>
						<span v-else-if="v.salary_max>=100">{{v.salary_min}}元以上</span>
						<span v-else>{{v.salary_min}}-{{v.salary_max}}元</span>
					</div>
					<div v-else>
						<span v-if="v.salary_min <= 0 && v.salary_max >=100">面议</span>
						<span v-else-if="v.salary_max>=100">{{v.salary_min}}K以上</span>
						<span v-else>{{v.salary_min}}-{{v.salary_max}}K</span>
					</div>
				</div>
			</div>
		</div>
		<div class="flex flex-center">
			<div class="w-100px">更多筛选：</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.industry}" @click="setShowSearchBody('industry')">所属行业
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='industry'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.size_type!==''}" @click="setShowSearchBody('size_type')">企业规模
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='size_type'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.education_level!==''}" @click="setShowSearchBody('education_level')">学历要求
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='education_level'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.exp_level!==''}" @click="setShowSearchBody('exp_level')">工作经验
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='exp_level'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.finance}" @click="setShowSearchBody('finance')">融资阶段
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='finance'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="flex-1"></div>
			<div class="py-3 pointer" @click="clearSearchItem">清空筛选</div>
		</div>
	</div>
	<div class="search-item-body pb-4 container-xl" v-show="showSearchBody">
		<div class="bg-white shadow px-3 py-1">
			<div class="flex flex-center" v-if="showSearchBody=='industry'">
				<div class="w-100px">所属行业：</div>
				<div class="flex-1">
					<div style="max-height: 160px;overflow-x: hidden;overflow-y: auto;" class="row">
						<div class="col-3 pr-3 py-3 pointer" :class="{'text-primary':search.industry==0}" @click="setSearchItemIndustry(0)">不限</div>
						<div class="col-3 pr-3 py-3 text-nowrap pointer" v-for="(v,index) in industry" :class="{'text-primary':search.industry==v.id}" @click="setSearchItemIndustry(v.id)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='size_type'">
				<div class="w-100px">企业规模：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.size_type===''}" @click="setSearchItemSizeType('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in size_type" :class="{'text-primary':search.size_type===v.value}" @click="setSearchItemSizeType(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='jobs_type'">
				<div class="w-100px">工作性质：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.jobs_type===''}" @click="setSearchItemJobsType('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in jobs_type" :class="{'text-primary':search.jobs_type===v.value}" @click="setSearchItemJobsType(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='education_level'">
				<div class="w-100px">学历要求：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.education_level===''}" @click="setSearchItemEducationLevel('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in education_level" :class="{'text-primary':search.education_level===v.value}" @click="setSearchItemEducationLevel(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='exp_level'">
				<div class="w-100px">工作经验：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.exp_level===''}" @click="setSearchItemExpLevel('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in exp_level" :class="{'text-primary':search.exp_level===v.value}" @click="setSearchItemExpLevel(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='update_time'">
				<div class="w-100px">更新时间：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.update_time===''}" @click="setSearchItemUpdateTime('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in update_time" :class="{'text-primary':search.update_time===v.value}" @click="setSearchItemUpdateTime(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='finance'">
				<div class="w-100px">融资阶段：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.finance===''}" @click="setSearchItemFinance('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in finance" :class="{'text-primary':search.finance===v.value}" @click="setSearchItemFinance(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="container-xl py-3">
	<div class="flex">
		<div class="flex-1 pr-3">
			<div class="bg-white flex px-3 flex-center shadow text-666666">
				<div class="px-4 py-2 pointer border-bottom border-white border-lg"
				:class="{'border-primary text-primary':search.is_famous==0}"
				@click="setSearchItemIsFamous(0)">所有职位</div>
				<div class="px-4 py-2 pointer border-bottom border-white border-lg"
				:class="{'border-primary text-primary':search.is_famous==1}"
				@click="setSearchItemIsFamous(1)">名企招聘</div>
				<div class="flex-1"></div>
				<div class="px-4 pointer" 
				:class="{'text-primary':search.prop=='default'}" 
				@click="setSearchItemProp('default')">综合排序<i class="el-icon-bottom ml-2 font-weight-bold"></i></div>
				<div class="px-4 pointer" 
				:class="{'text-primary':search.prop=='update_time'}" 
				@click="setSearchItemProp('update_time')">更新时间<i class="el-icon-bottom ml-2 font-weight-bold"></i></div>
				<div class="border-left px-4">{{search.current_page}} / {{search.last_page}}</div>
				<div class="px-4 pointer"
				@click="listViewType= !listViewType">{{listViewType?'详情':'列表'}}</div>
			</div>
			<div v-if="!listViewType">
				<div class="mt-3 bg-white shadow" v-if="list.length>0" v-for="(v,index) in list">
					<div class="flex p-4">
						<div class="flex-1 pr-3">
							<a :href="'/jobs/'+v.id+'.html'" target="_blank">
								<div class="h6 mb-0 text-0143B1"
								:class="{'text-danger':v.urgent}">{{v.title}}<span class="small">[{{v.jobs_city}}·{{v.jobs_area}}]</span>
					  			<img src="__TEMPLATE_STATIC__/icon/icon_recommend.png" height="25" v-if="v.recommend">
					  			<img src="__TEMPLATE_STATIC__/icon/icon_urgent.png" height="25" v-if="v.urgent">
					  			<img src="__TEMPLATE_STATIC__/icon/icon_top.png" height="25" v-else-if="v.top">
								</div>
							</a>
							<div class="text-secondary small mb-1">发布于{{v.friendly_create_time}}</div>
							<div class="h6 text-primary flex flex-center">
								<div v-if="v.salary_min>0" class="text-ec6334">
								<span v-if="v.jobs_salary_show_type">{{v.salary_min}}-{{v.salary_max}}元</span>
								<span v-else>{{v.salary_min}}-{{v.salary_max}}k</span>
								<span class="text-danger" v-if="v.salary_year>12">·{{v.salary_year}}薪</span>
								</div>
								<div v-else class="text-ec6334">面议</div>
								<div class="text-secondary ml-2 small">{{v.education}}丨{{v.exp_level}}</div>
							</div>
						</div>
						<div class="flex-1">
							<div>
								<a :href="'/company/'+v.company_id+'.html'" target="_blank" class="el-link el-link--primary">{{v.scompany_name?v.scompany_name:v.company_name}}</a>
							</div>
							<div class="text-secondary">{{v.industry}}丨{{v.size_type}}</div>
						</div>
						<div class="pl-3">
							<el-button type="info" size="mini" v-if="v.is_delivery">已投递</el-button>
							<el-button type="primary" size="mini" @click="deliveryResume(v);" v-else="v.is_delivery">投递简历</el-button>
							<div class="text-center pt-2 pointer" @click="toggleJobsCollection(v)" v-if="v.is_collection"><i class="el-icon-star-on mr-1"></i>取消收藏</div>
							<div class="text-center pt-2 pointer" @click="toggleJobsCollection(v)" v-if="!v.is_collection"><i class="el-icon-star-off mr-1"></i>收藏</div>
						</div>
					</div>
					<div class="px-4 py-2 bg-light" v-if="v.welfare.length>0">
						<el-tag type="success" size="mini" v-for="welfare in v.welfare" class="mr-2">{{welfare}}</el-tag>
					</div>
				</div>
			</div>
			<el-table
		      :data="list"
		      style="width: 100%"
		      class="mt-3"
      		  header-cell-class-name="bg-light"
		      v-else>
		      <el-table-column
		        prop="title"
		        label="职位名称"
		        width="180">
		        <template slot-scope="scope">
				<a :href="'/jobs/'+scope.row.id+'.html'" target="_blank" class="h6 text-0143B1" :class="{'text-danger':scope.row.urgent}">
					{{scope.row.title}}
		  			<img src="__TEMPLATE_STATIC__/icon/icon_recommend.png" height="25" v-if="scope.row.recommend">
				</a>
		        <div class="small">{{scope.row.jobs_city}}·{{scope.row.jobs_area}}</div>
		        </template>
		      </el-table-column>
		      <el-table-column
		        label="公司名">
		        <template slot-scope="scope">
				<a :href="'/company/'+scope.row.company_id+'.html'" target="_blank" class="el-link text-666666">{{scope.row.scompany_name?scope.row.scompany_name:scope.row.company_name}}</a>
		        </template>
		      </el-table-column>
		      <el-table-column
		        label="待遇"
		        width="160">
		        <template slot-scope="scope">
		        	<div v-if="scope.row.salary_min>0">
					<span class="text-ec6334" v-if="scope.row.jobs_salary_show_type">{{scope.row.salary_min}}-{{scope.row.salary_max}}元</span>
					<span class="text-ec6334" v-else>{{scope.row.salary_min}}-{{scope.row.salary_max}}k</span>
					<span class="text-danger" v-if="scope.row.salary_year>12">·{{scope.row.salary_year}}薪</span>
		        	</div>
					<span v-else class="text-ec6334">面议</span>
		        </template>
		      </el-table-column>
		      <el-table-column
		        prop="friendly_create_time"
		        label="发布时间"
		        width="160">
		        <template slot-scope="scope">
		  			<img src="__TEMPLATE_STATIC__/icon/icon_urgent.png" height="25" v-if="scope.row.urgent">
		  			<img src="__TEMPLATE_STATIC__/icon/icon_top.png" height="25" v-else-if="scope.row.top">
		        	<div v-else>{{scope.row.friendly_create_time}}</div>
		        </template>
		      </el-table-column>
		      <el-table-column
		        label="操作"
		        width="100">
		        <template slot-scope="scope">
					<el-button type="info" size="mini" v-if="scope.row.is_delivery">已投递</el-button>
					<el-button type="primary" size="mini" @click="deliveryResume(scope.row);" v-else="scope.row.is_delivery">投递简历</el-button>
		        </template>
		      </el-table-column>
		    </el-table>
			<div class="p-3 text-center text-secondary" v-if='list.length<=0&&!listViewType'>暂无数据</div>
			<div class="text-center mt-3 bg-white py-3 shadow" v-if='list.length>0'>
				<el-pagination
				  background
      			  @current-change="handleCurrentChange"
				  layout="prev, pager, next"
			      :page-size="search.per_page"
			      :current-page="search.page"
				  :total="search.total">
				</el-pagination>
			</div>	
		</div>
		<div class="w-350px">
			<div class="ads">
				{xycms:ads alias="search_jobs" name='v' length='3'}
		      	<div class="text-v-center shadow mb-3">
		      		{empty name="v.url"}
			      	<a title="{$v.title}" class="{$v.ads_icon?'ads-icon':''}">
		      		{else/}
			      	<a href="{$v.url}" class="s {$v.ads_icon?'ads-icon':''}" target="_blank" title="{$v.title}">
		      		{/empty}
						<img src="{xycms:web name="imgurl"/}{$v.path}" class="w-350px">
			      	</a>
		      	</div>
				{/xycms:ads}
			</div>
			{xycms:jobslist name="JobsList" new="1"}
			<div class="bg-white p-3 shadow">
				<div class="block-title-before pb-2">最新职位</div>
				{volist name="JobsList" id="v"}
				<a href="/jobs/{$v.id}.html" target="_blank" class="flex py-3 flex-center">
					<div class="border w-80px h-80px text-truncate rounded-lg">
						<img src="{$v.logo}" style="object-fit: contain;width: 100%;height: 100%;">
					</div>
					<div class="flex-1 pl-2">
						<h6 class="mb-1 text-secondary text-truncate">{$v.title}</h6>
						<div class="h6 text-ec6334 mb-3">
							{gt name="v.salary_min" value="0"}
							{eq name="v.jobs_salary_show_type" value="1"}
							{$v.salary_min}-{$v.salary_max}元
							{else/}
							{$v.salary_min}-{$v.salary_max}k
							{/eq}
							{else/}
							面议
							{/gt}
						</div>
						<div class="text-secondary flex">
							<div class="flex-1 text-truncate">
						{empty name="v.company_name"}
						{$v.company_name}
						{else/}
						{$v.scompany_name}
						{/empty}
					</div>
							<div>{$v.jobs_city}</div>
						</div>
					</div>
				</a>
				{/volist}
			</div>
			{/xycms:jobslist}
		</div>
	</div>
</div>
{/block}
{block name="footer"}
{include file="module/footer"/}
{include file="module/login"/}
{/block}
{block name="script"}
<script type="text/javascript">
	var salary=[
		{salary_min:0,salary_max:100},
		{salary_min:1,salary_max:3},
		{salary_min:3,salary_max:5},
		{salary_min:5,salary_max:10},
		{salary_min:10,salary_max:20},
		{salary_min:20,salary_max:50},
		{salary_min:50,salary_max:100},
		];
	var jobscatelist={xycms:jobscate serialize="json"/};
	var arealist={xycms:arealist serialize="json"/};
	var industry={xycms:industry serialize="json"/};
	var finance={xycms:statusalias name="company/finance" serialize="json"/};
	var size_type={xycms:statusalias name="company/size_type" serialize="json"/};
	var education_level={xycms:statusalias name="jobs/education_level" serialize="json"/};
	var exp_level={xycms:statusalias name="jobs/exp_level" serialize="json"/};
</script>
<script type="text/javascript">
	var vm=new Vue({
		el:'#app',
		data:{
			view:XYBase.view,
			loginTabs:XYBase.loginTabs,
			userInfo:UserInfo,
			feedback:XYBase.feedback,
			confirm:0,
			jobs_salary_show_type:{xycms:companyconfig name="jobs_salary_show_type"/},
			hoverCityKey:'A',
			showSearchBody:'',
			showAllCity:false,
			salary:salary,
			jobscatelist:jobscatelist,
			arealist:arealist,
			city:[],
			area:[],
			industry:industry,
			finance:finance,
			size_type:size_type,
			education_level:education_level,
			exp_level:exp_level,
			cid:[],
			jobs_type:[{value:0,title:'实习'},{value:1,title:'全职'}],
			update_time:[{value:1,title:'今天以内'},{value:2,title:'三天以内'},{value:3,title:'七天以内'}],
			listViewType:false,
	        defaultProps: {
	          	value: 'id',
	          	label: 'title',
	          	children: 'data',
	        },
			search:{
				ajax:false,
				salary_min:'',
				salary_max:'',
				key:'{notempty name=":request()->get('key')"}{:request()->get('key')}{/notempty}',
				cid:'{:request()->get('cid')}',
				company_id:{empty name=":request()->get('company_id')"}0{else/}{:request()->get('company_id')}{/empty},
				province:'',
				city:'',
				area:'',
				industry:0,
				finance:'',
				size_type:'',
				jobs_type:'',
				education_level:'',
				exp_level:'',
				update_time:'',
				is_famous:0,
				prop:'default',
				per_page:10,
				current_page:0,
				last_page:0,
				total:0,
				page:{:request()->get('page',1)}
			},
			list:[]
		},
		watch:{
		    view:XYBase.viewWatch,
		    loginTabs:XYBase.loginTabsWatch,
		    listViewType(val,oldVal){
		    	if(val){
		    		XYBase.setCookie('jobsListViewType',1);
		    	}else{
		    		XYBase.delCookie('jobsListViewType');
		    	}
		    }
		},
		created(){
			XYBase.created(this);
			this.listViewType=XYBase.getCookie('jobsListViewType')?true:false;
			this.initHtml();
		},
		methods:XYBase.methods({
			setSearchItemSalary(obj){
				if(obj){
					this.search.salary_min=obj.salary_min;
					this.search.salary_max=obj.salary_max;
				}else{
					this.search.salary_min='';
					this.search.salary_max='';
				}
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemCid(val){
				if (val) {
					this.search.cid=val[2];
				}else{
					this.search.cid='';
				}
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemCity(val){
			    this.search.province='';
			    this.search.city='';
			    this.search.area='';
			    if(val){
			        switch(val.level){
			            case 1:
				        this.search.province=val.id;
				        this.city=val.data;
			    		this.area=[];
			            break;
			            case 2:
				        this.search.city=val.id;
				        this.area=val.data;
			            break;
			            case 3:
				        this.search.area=val.id;
			            break;
			        }
			    }else{
			    	this.city=[];
			    	this.area=[];
			    }
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemWelfare(val){
				this.search.welfare=val;
				/*if (val) {
					if (this.search.welfare.length>=6) return  XYBase.msg('最多选择6项福利');
					var index=this.search.welfare.indexOf(val.value);
					if (index>-1) {
						this.search.welfare.splice(index,1);
					}else{
						this.search.welfare.push(val.value);
					}
				}else{
					this.search.welfare=[];
				}*/
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemIndustry(val){
				this.search.industry=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemFinance(val){
				this.search.finance=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemSizeType(val){
				this.search.size_type=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemJobsType(val){
				this.search.jobs_type=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemEducationLevel(val){
				this.search.education_level=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemExpLevel(val){
				this.search.exp_level=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemUpdateTime(val){
				this.search.update_time=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemKey(){
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemProp(val){
				this.search.prop=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemIsFamous(val){
				this.search.is_famous=val;
				this.search.page=1;
				this.initHtml();
			},
			setShowSearchBody(el){
				if (el==this.showSearchBody) {
					this.showSearchBody='';
				}else{
					this.showSearchBody=el;
				}
			},
			clearSearchItem(){
				this.search.page=1;
				this.search.salary_min=0;
				this.search.salary_max=100;
				this.search.key='';
				this.search.city='';
				this.search.cid=0;
				this.search.industry=0;
				this.search.finance='';
				this.search.size_type='';
				this.search.jobs_type='';
				this.search.education_level='';
				this.search.exp_level='';
				this.search.update_time='';
				this.showSearchBody='';
				this.initHtml();
			},
			handleCurrentChange(val){
				this.search.page=val;
				this.initHtml();
			},
			initHtml(){
				var _this=this;
				if (_this.search.ajax) return XYBase.msg('操作频繁，请稍后再试');
				_this.search.ajax=true;
				_this.sendGet({
					url:'/search/jobs',
					data:_this.search
				},function(ret){
					_this.search.ajax=false;
					if (ret) {
						_this.list=[];
						if (ret.code === 0) {
							_this.search.total=ret.data.total;
							_this.search.per_page=ret.data.per_page;
							_this.search.current_page=ret.data.current_page;
							_this.search.last_page=ret.data.last_page;
							_this.list=ret.data.data;
						}else{
							XYBase.msg(ret.msg);
							_this.search.current_page=0;
							_this.search.last_page=0;
						}
					}
				});
			},
		})
	});
</script>
{/block}